﻿Imports System
Imports System.Collections.Generic
Imports System.Workflow.ComponentModel

Namespace System.Workflow.ComponentModel.Compiler
    Friend NotInheritable Class SynchronizationValidator
        Inherits Validator
        ' Methods
        Public Overrides Function Validate(ByVal manager As ValidationManager, ByVal obj As Object) As ValidationErrorCollection
            Dim errors As ValidationErrorCollection = MyBase.Validate(manager, obj)
            Dim activity As Activity = [TryCast](obj,Activity)
            If (Not activity Is Nothing) Then
                Dim is2 As ICollection([Of] String) = [TryCast](activity.GetValue(Activity.SynchronizationHandlesProperty),ICollection([Of] String))
                If (is2 Is Nothing) Then
                    Return errors
                End If
                Dim str As String
                For Each str In is2
                    Dim item As ValidationError = ValidationHelpers.ValidateIdentifier("SynchronizationHandles", manager, str)
                    If (Not item Is Nothing) Then
                        errors.Add(item)
                    End If
                Next
            End If
            Return errors
        End Function

    End Class
End Namespace

